"""数据库表操作"""
from django.db import models


# Create your models here.

class Model(models.Model):
    id = models.AutoField(primary_key=True)
    user_id = models.CharField(max_length=15,default='',null=False)
    model_name = models.CharField(max_length=50,default='',unique=False)
    create_time = models.DateTimeField(auto_now_add=True)
    dataset_name = models.CharField(max_length=50,null=True, blank=True)
    learning_rate = models.FloatField(null=True, blank=True)
    batch_size = models.IntegerField(null=True, blank=True)
    train_start_time = models.DateTimeField(null=True, blank=True)
    train_end_time = models.DateTimeField(null=True, blank=True)
    status = models.CharField(max_length=15,default='',null=False)
    ROUGE_1 = models.FloatField(null=True, blank=True)
    ROUGE_2 = models.FloatField(null=True, blank=True)
    ROUGE_L = models.FloatField(null=True, blank=True)
    model_path = models.CharField(max_length=200, null=True, blank=True)
    train_log_path = models.CharField(max_length=200,null=True, blank=True)



class Dataset(models.Model):
    id = models.AutoField(primary_key=True)
    user_id = models.CharField(max_length=15,default='', null=False)
    dataset_name = models.CharField(max_length=50,default='', null=False)
    create_time = models.DateTimeField(auto_now_add=True)
    dataset_path = models.CharField(max_length=200, null=True, blank=True)


